﻿using System;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using MSAP.Framework.Interfaces;
using MSAP.Framework;

namespace PLL.Accueil
{
    public class CreateAccueilServicePage_SA : ServiceActionCommand
    {
        public CreateAccueilServicePage_SA(AccueilModule module)
            : base("ACCUEIL.ACCUEIL_SA", "ACCUEIL.CREATE_ACCUEIL_SP", "Accueil", "Affiche la page d'Accueil",
                   null, null,
                   true, new BitmapImage(new Uri("/PLL.Accueil;component/Resources/Accueil.png", UriKind.Relative)),
                   module)
        {
            this.execute = parameter => CreateServicePage(parameter);
            this.canExecute = canParameter => CanCreateServicePage(canParameter);
        }

        private void CreateServicePage(object parameter)
        {
            Module.AddServicePage(new AccueilServicePage(Module as AccueilModule));
        }

        private bool CanCreateServicePage(object parameter)
        {
            return true;
        }
    }
}
